#include <iostream>
#include <iomanip>
#include <string>

#if 1
using namespace std;
#else
using std::cout;
using std::endl;
#endif

int main(int argc, char *argv[])
{
	int idx = 0;
	string str;
	string line;
	cout<<line<<endl;

	while (cin >> line)
	{
		if (line == "q")
			break;
			
		str += line;
		str += "\n";
		idx++;
	}
	
	cout << str << endl;
	cout << "lines is "<< idx << endl;
	cout << "size is "<< str.size()<<endl;
	
	return 0;
}
